package com.zzdx.deployment.system.service.impl;

import com.zzdx.deployment.common.support.Convert;
import com.zzdx.deployment.system.domain.ProductResource;
import com.zzdx.deployment.system.mapper.ProductResourceMapper;
import com.zzdx.deployment.system.service.IProductResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 产品资源 服务层实现
 * 
 * @author ruoyi
 * @date 2018-12-25
 */
@Service
public class ProductResourceServiceImpl implements IProductResourceService 
{
	@Autowired
	private ProductResourceMapper productResourceMapper;

	/**
     * 查询产品资源信息
     * 
     * @param id 产品资源ID
     * @return 产品资源信息
     */
    @Override
	public ProductResource selectProductResourceById(Integer id)
	{
	    return productResourceMapper.selectProductResourceById(id);
	}

	@Override
	public ProductResource selectProductByRelative(String resourceRelativePath) {
		return productResourceMapper.selectProductResourceByRelative(resourceRelativePath);
	}



	/**
     * 查询产品资源列表
     * 
     * @param productResource 产品资源信息
     * @return 产品资源集合
     */
	@Override
	public List<ProductResource> selectProductResourceList(ProductResource productResource)
	{
	    return productResourceMapper.selectProductResourceList(productResource);
	}
	
    /**
     * 新增产品资源
     * 
     * @param productResource 产品资源信息
     * @return 结果
     */
	@Override
	public int insertProductResource(ProductResource productResource)
	{
	    return productResourceMapper.insertProductResource(productResource);
	}
	
	/**
     * 修改产品资源
     * 
     * @param productResource 产品资源信息
     * @return 结果
     */
	@Override
	public int updateProductResource(ProductResource productResource)
	{
	    return productResourceMapper.updateProductResource(productResource);
	}

	/**
     * 删除产品资源对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteProductResourceByIds(String ids)
	{
		return productResourceMapper.deleteProductResourceByIds(Convert.toStrArray(ids));
	}
	
}
